package org.jeecg.modules.app.mapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.app.entity.AppUpgrade;

import java.util.List;

/**
 * @Description: 更新管理
 * @Author: sean
 * @Date:   2024-09-28
 * @Version: V1.0
 */
public interface AppUpgradeMapper extends BaseMapper<AppUpgrade> {

    IPage<AppUpgrade> selectJoinPage(@Param("page") Page page, @Param("param") AppUpgrade params);

    IPage<AppUpgrade> selectJoinPage(@Param("page") Page page, @Param(Constants.WRAPPER) Wrapper wrapper);



    AppUpgrade selectLatestByClientIdAndPlatformType(@Param("clientId") Long clientId,@Param("platformType")  String platformType);

    /**
     * 获取版本最大的版本记录
     * @param clientId
     * @param pkgTypeList
     * @return
     */
    @InterceptorIgnore(tenantLine = "true")
    AppUpgrade getMaxVersionRecord(@Param("clientId") Long clientId, @Param("pkgTypeList") List<String> pkgTypeList);

    @InterceptorIgnore(tenantLine = "true")
    List<AppUpgrade> selectListNoTenant(@Param(Constants.WRAPPER) Wrapper wrapper);

    @InterceptorIgnore(tenantLine = "true")
    List<AppUpgrade> latestRecords(@Param("clientIds") List<Long> clientIds);
}
